package com.bnq.logc.native

import java.io.File

class NativeLogc {
    companion object{
        init {
            System.loadLibrary("lib-logc")
            //System.loadLibrary("clog")
        }

        fun getFileCreateTimeStamp(file: File):Long{
            return if(file.exists()){
                getFileCreateTimeStamp(file.absolutePath)
            }else{
                0
            }
        }

        fun getFileCreateTimeStamp(path:String):Long{
            try{
                val sec = getFileCreateTime(path)
                if(sec > 0){
                    return sec * 1000
                }
            }catch (e:Exception){
                e.printStackTrace()
            }
            return 0
        }

        @JvmStatic
        private external fun getFileCreateTime(path:String):Long
    }
}